import { request } from "../../request/index.js"
Page({
  data: {
    swiperList: [],
    cateList: [],
    floorList: []
  },
  //options(Object)
  onLoad: function (options) {
    this.swiperList()
    this.getcateList()
    this.getfloorList()
  },
  // 获取轮播图
  async swiperList() {
    const res = await request({
      url: "home/swiperdata"
    })
    this.setData({
      swiperList: res.data.message
    })

  },
  async getcateList() {
    const res = await request({
      url: "home/catitems"
    })
    this.setData({
      cateList: res.data.message
    })
  },
  async getfloorList() {
    const res = await request({
      url: "home/floordata"
    })
    this.setData({
      floorList: res.data.message
    })

  }
});
